<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    // var now = new Date();
    // now.getFullYear();
    // now.getMonth();
    // now.getDate();
    // now.getDay();//周几
    // now.getHours();
    // now.getMinutes();
    // now.getSeconds();
    //
    // now.getTime();//时间戳
    // now.toLocaleString();//返回合适的格式
    let user = {
        name: "zhourui",
        age: 24
    };
    let jsonUser = JSON.stringify(user);//得到的是一个json字符串
    //将json字符串转为json, 注意单双引号需要交错, kv都要被括起来
    let jsonUser2 = JSON.parse('{"name": "zhourui", "age": 24}');
</script>
</body>
</html>